package com.awangyh.jdk8.map;

import com.awangyh.jdk8.file.NetValueItem;
import com.awangyh.jdk8.json.JsonUtil;

import java.util.SortedMap;
import java.util.UUID;

/**
 * Created by admin on 2017/4/13.
 */
public class SortedMapDemo {
    public static void main(String[] args) {

        NetValueItem item = new NetValueItem();
        item.setCode("sdfsdfs");
        item.setName("test demo");
        item.setShortFilename("fileName");
        item.setSource(11);
        item.setType(222);

        String json = JsonUtil.getGson().toJson(item);
        SortedMap<String, Object> map = JsonUtil.getGson().fromJson(json, SortedMap.class);

        map.entrySet().forEach(it -> System.out.println("key: " + it.getKey() + ", value: " + it.getValue()));

        System.out.println(UUID.randomUUID().toString());
    }
}
